#include <QCoreApplication>
#include "shnet.h"
#include "url.h"
#include "tester.h"
#include "propertyfilter.h"
#include "signalfilter.h"

#include <QMetaProperty>

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);


    ShNet net;
    qDebug() << (net.join(QHostAddress("192.168.7.6"),
                         QHostAddress("239.1.1.1"), 45454, "rpc",
                          QStringList() << "group1")
                ? "joined" : "join failed");
    Tester t;

    net.addSignal("signal1", &t, SIGNAL(newSignal(int,QString,bool)));
    t.emitNewSignal();

//    net.addProperty("pr1", false, &t, "tp");
//    net.setProperty("pr1", "mega value");
//    net.addSignal("s1", &t, SIGNAL(testSignal(QVariant)));
//    t.emitTest();

//    net.propertyFilter()->add(Url("NB/pr1"), PropertyFilter::SLOT_CALL,
//                              &t, "change");
    //net.signalFilter()->connect(Url("NB/s1"), &t, SLOT(change(QVariant)));


    
    return a.exec();
}
